package com.xcc.tabbaranimdemo;

import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

import com.xcc.viewlibrary.TabBarAnimView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivity extends AppCompatActivity {
    @BindView(R.id.viewTabBarAnim)
    TabBarAnimView viewTabBarAnim;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);
    }

    @OnClick({R.id.tab1, R.id.tab2, R.id.tab3, R.id.tab4, R.id.tab5})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tab1:
                viewTabBarAnim.setSelectIndex(0);
                break;
            case R.id.tab2:
                viewTabBarAnim.setSelectIndex(1);
                break;
            case R.id.tab3:
                viewTabBarAnim.setSelectIndex(2);
                break;
            case R.id.tab4:
                viewTabBarAnim.setSelectIndex(3);
                break;
            case R.id.tab5:
                viewTabBarAnim.setSelectIndex(4);
                break;
        }
    }
}
